﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartSpace.Core
{
    /// <summary>
    /// 导航信息
    /// </summary>
    public class Navigation : ICodeEntity
    {
        public Guid Id { get; set; }
        public string Code { get; set; }
        /// <summary>
        /// 所在站点id
        /// </summary>
        public Guid SiteId { get; set; }
        /// <summary>
        /// 所在页面id，如果为null则表示是站点级别的导航信息
        /// </summary>
        public Guid? PageId { get; set; }
        public Guid? ImageId { get; set; }
        public Guid? ParentId { get; set; }
        public string Caption { get; set; }
        public string Description { get; set; }

        public string TargetType { get; set; }
        public Guid? TargetId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string Url { get; set; }

        /// <summary>
        /// 连接到url地址时，所使用的参数列表 arg1=a1&arg2=a2
        /// </summary>
        public string Arguments { get; set; }
        /// <summary>
        /// 导航对应到的视图会切换到对应的视图容器编号
        /// </summary>
        public string ContainerCode { get; set; }
        public int SortIndex { get; set; }

        public List<Navigation> Children { get; set; }

        public Navigation()
        {
            Id = Guid.NewGuid();
        }

        public Navigation(string code, string caption, Guid? parentId, Guid siteId, Guid? pageId)
        {
            Id = Guid.NewGuid();
            this.Code = code;
            this.Caption = caption;
            this.ParentId = parentId;
            this.SiteId = siteId;
            this.PageId = pageId;
        }

        public void Validation()
        {
        }
    }
}
